function ageProp(target:any,propKey:string){
    console.log(target,propKey);

    // Object.defineProperty(target,propKey,{value:30});
    target[propKey] = 30;
}

function method(target:any,propKey:string,desc:PropertyDescriptor){
    desc.writable = false;
}

function addStaticProp(target:Function){
    Object.defineProperty(target,"love",{value:"爱好啊"})
}

@addStaticProp
class Person {
    static love(love: any) {
        throw new Error("Method not implemented.");
    }
    _name: string;
    @ageProp
    age!: number;
    constructor() {
        this._name = "Liguanh";
    }

    get name(){
        console.log("获取数据")
        return this._name;
    }

    set name(name:string){
        console.log("控制修改")
        this._name = name;
    }
    @method
    say() {
        return "static function"
    }
}


let person = new Person();

console.log(person.name);
person.name = "科比"

// person.say = function(){
//     return "xxxxx";
// }

console.log(Person?.love);